<template>
  <div class="activity-detail">
    <div v-if="activity" class="activity-content">
      <h1>{{ activity.title }}</h1>
      <p><strong>日期：</strong>{{ activity.date }}</p>
      <p><strong>地点：</strong>{{ activity.location }}</p>
      <p><strong>描述：</strong>{{ activity.description }}</p>
    </div>
    <div v-else>
      <p>活动不存在或已删除</p>
    </div>
  </div>
</template>

<script>
import activities from '@/data/activities.js';

export default {
  data() {
    return {
      activity: null
    };
  },
  created() {
    const activityId = parseInt(this.$route.params.id);
    this.activity = activities.find(activity => activity.id === activityId);
  }
};
</script>

<style scoped>
.activity-detail {
  max-width: 800px;
  margin: 2em auto;
  padding: 2em;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.activity-content p {
  margin-bottom: 1em;
}
</style>